﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Shakes_and_Fidget___Charplaner.Classes
{
	public class Player : Unit
	{
		#region character
		public int bonus_str { get; set; }
		public int bonus_dex { get; set; }
		public int bonus_int { get; set; }
		public int bonus_stam { get; set; }
		public int bonus_luck { get; set; }
		public int temp_str { get; set; }
		public int temp_dex { get; set; }
		public int temp_int { get; set; }
		public int temp_stam { get; set; }
		public int temp_luck { get; set; }
		public int accountid { get; set; }
		public int xpnow { get; set; }
		public int xplevel { get; set; }
		public int honor { get; set; }
		public int rank { get; set; }
		public int gold { get; set; }
		public int mushrooms { get; set; }
		public int guildid { get; set; }
		public int battleswon { get; set; }
		public int adventures { get; set; }
		public int goldearned { get; set; }
		public int friendscalled { get; set; }
		public int medalbonus { get; set; }
		public Attribute flask1;
		public Attribute flask2;
		public Attribute flask3;
		public string chardescription { get; set; }
		#endregion
		#region dungeon
		public int dungeon1 { get; set; }
		public int dungeon2 { get; set; }
		public int dungeon3 { get; set; }
		public int dungeon4 { get; set; }
		public int dungeon5 { get; set; }
		public int dungeon6 { get; set; }
		public int dungeon7 { get; set; }
		public int dungeon8 { get; set; }
		public int dungeon9 { get; set; }
		public int dungeon10 { get; set; }
		public int dungeon11 { get; set; }
		public int dungeon12 { get; set; }
		#endregion
		#region equip
		public Item weapon, shield, breast, feet, hands, head, belt, necklace, ring, trinket;
		#endregion
		#region inventory
		Item[] inventory = new Item[5];
		#endregion
		#region misc
		public int timenow { get; set; }
		#endregion

		#region Constructor
		public Player(	Enums.Class class_,
						int level,
						int base_str,
						int base_dex,
						int base_int,
						int base_stam,
						int base_luck,
						int armor,
						int avoidchance = 0,
						int bonus_str = 0,
						int bonus_dex = 0,
						int bonus_int = 0,
						int bonus_stam = 0,
						int bonus_luck = 0,
						int temp_str = 0,
						int temp_dex = 0,
						int temp_int = 0,
						int temp_stam = 0,
						int temp_luck = 0,
						int accountid = 0,
						int xpnow = 0,
						int xplevel = 1,
						int honor = 0,
						int rank = 0,
						int gold = 0,
						int mushrooms = 0,
						int guildid = 0,
						int battleswon = 0,
						int adventures = 0,
						int goldearned = 0,
						int friendscalled = 0,
						int medalbonus = 0,
						int dungeon1 = 0,
						int dungeon2 = 0,
						int dungeon3 = 0,
						int dungeon4 = 0,
						int dungeon5 = 0,
						int dungeon6 = 0,
						int dungeon7 = 0,
						int dungeon8 = 0,
						int dungeon9 = 0,
						int dungeon10 = 0,
						int dungeon11 = 0,
						int dungeon12 = 0,
						string chardescription = "",
						int timenow = 0 )
			: base (class_, base_str, base_dex, base_int, base_stam, base_luck, level, armor, avoidchance)
		{
			this.class_ = class_;
			this.avoidchance = avoidchance;
			this.base_str = base_str;
			this.base_dex = base_dex;
			this.base_int = base_int;
			this.base_stam = base_stam;
			this.base_luck = base_luck;
			this.bonus_str = bonus_str;
			this.bonus_dex = bonus_dex;
			this.bonus_int = bonus_int;
			this.bonus_stam = bonus_stam;
			this.bonus_luck = bonus_luck;
			this.temp_str = temp_str;
			this.temp_dex = temp_dex;
			this.temp_int = temp_int;
			this.temp_stam = temp_stam;
			this.temp_luck = temp_luck;
			this.accountid = accountid;
			this.level = level;
			this.xpnow = xpnow;
			this.xplevel = xplevel;
			this.honor = honor;
			this.rank = rank;
			this.gold = gold;
			this.mushrooms = mushrooms;
			this.guildid = guildid;
			this.armor = armor;
			this.battleswon = battleswon;
			this.adventures = adventures;
			this.goldearned = goldearned;
			this.friendscalled = friendscalled;
			this.medalbonus = medalbonus;
			this.dungeon1 = dungeon1;
			this.dungeon2 = dungeon2;
			this.dungeon3 = dungeon3;
			this.dungeon4 = dungeon4;
			this.dungeon5 = dungeon5;
			this.dungeon6 = dungeon6;
			this.dungeon7 = dungeon7;
			this.dungeon8 = dungeon8;
			this.dungeon9 = dungeon9;
			this.dungeon10 = dungeon10;
			this.dungeon11 = dungeon11;
			this.dungeon12 = dungeon12;
			this.chardescription = chardescription;
			this.timenow = timenow;

			this.end_str = GetSTR();
			this.end_dex = GetDEX();
			this.end_int = GetINT();
			this.end_stam = GetSTAM();
			this.end_luck = GetLUCK();
			if (this.weapon != null && this.weapon.extra1 != 0 && this.weapon.extra2 != 0)
			{
				weapondamage[0] = this.weapon.extra1;
				weapondamage[1] = this.weapon.extra2;
			}
		}

		public Player()
		{ }
		#endregion

		#region Get's
		public override int GetSTR()
		{
			end_str = base_str + bonus_str + temp_str; 
			return end_str;
		}
		public override int GetDEX()
		{ 
			end_dex = base_dex + bonus_dex + temp_dex;
			return end_dex;
		}
		public override int GetINT()
		{ 
			end_int = base_int + bonus_int + temp_int;
			return end_int;
		}
		public override int GetSTAM()
		{ 
			end_stam = base_stam + bonus_stam + temp_stam;
			return end_stam;
		}
		public override int GetLUCK()
		{
			end_luck = base_luck + bonus_luck + temp_luck;
			return end_luck; 
		}
		public void SetWeaponDamage()
		{
			if (this.weapon != null && this.weapon.extra1 != 0 && this.weapon.extra2 != 0)
			{
				weapondamage[0] = this.weapon.extra1;
				weapondamage[1] = this.weapon.extra2;
			}
		}
		#endregion

		#region Set's
		public void AddBaseAttributePoints(int value, Enums.Stat stat)
		{
			switch (stat)
			{
				case Enums.Stat.STRENGTH:
					this.base_str += value;
					break;
				case Enums.Stat.DEXTERITY:
					this.base_dex += value;
					break;
				case Enums.Stat.INTELLIGENCE:
					this.base_int += value;
					break;
				case Enums.Stat.STAMINA:
					this.base_stam += value;
					break;
				case Enums.Stat.LUCK:
					this.base_luck += value;
					break;
				case Enums.Stat.ALLSTATS:
					this.base_str += value;
					this.base_dex += value;
					this.base_int += value;
					this.base_stam += value;
					this.base_luck += value;
					break;
			}
		}
		public void AddBonusAttributePoints(int value, Enums.Stat stat)
		{
			switch (stat)
			{
				case Enums.Stat.STRENGTH:
					this.bonus_str += value;
					break;
				case Enums.Stat.DEXTERITY:
					this.bonus_dex += value;
					break;
				case Enums.Stat.INTELLIGENCE:
					this.bonus_int += value;
					break;
				case Enums.Stat.STAMINA:
					this.bonus_stam += value;
					break;
				case Enums.Stat.LUCK:
					this.bonus_luck += value;
					break;
				case Enums.Stat.ALLSTATS:
					this.bonus_str += value;
					this.bonus_dex += value;
					this.bonus_int += value;
					this.bonus_stam += value;
					this.bonus_luck += value;
					break;
			}
		}
		#endregion

	}
}
